import request from "@/utils/request.ts";
import type { DoctorPage, KnowledgePage, KnowledgeParams, PageParams, FollowType } from "@/types/homeTypes";
import type { ResponseType } from "@/types/responseTypes";

enum Enum {
    knowledgeList = "/patient/home/knowledge",
    followDoctor = "/home/page/doc",
    follow = "/like"
}

/*获取文章知识列表的接口*/
export const fetchKnowledgeListAPI = (params: KnowledgeParams): Promise<ResponseType<KnowledgePage>> => request.get<KnowledgePage, ResponseType<KnowledgePage>>(Enum.knowledgeList, { params });
/*获取关注的医生列表*/
export const fetchFollowDoctorListAPI = (params: PageParams): Promise<ResponseType<DoctorPage>> => request.get<DoctorPage, ResponseType<DoctorPage>>(Enum.followDoctor);
/*关注的接口*/
export const followAPI = (type: FollowType, id: string): Promise<ResponseType<{ id: string }>> => request.post<{ id: string }, ResponseType<{ id: string }>>(Enum.follow,{type,id});
